<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <meta name="author" content="">
    <title></title>
    <% include("../inc/input_css.html"){}%>
    <style>
        label{
            width: 140px!important;
        }
    </style>
    <%
    var isAdd = false;
    var isEdit = false;
    if(isEmpty(member.id)){
    isAdd = true;
    }else{
    isEdit = true;
    }
    %>
<body>
<div class="ibox">
    <div class="ibox-title">
        <div class="pull-left mbx navbar_title">
            <span class="current">品牌账号</span>
            <span class="line">/</span>
            <span class="current"><a href="/shop/user/list">账号管理</a></span><span class="line">/</span>
            <%if(isAdd){%>添加账号<%}else{%>编辑账号<%}%>
        </div>
    </div>
    <div class="ibox-content">
        <div class="wrapper wrapper-content">
            <div class="row">
                <div class="padding-40">
                    <form method="post" action="<%if (isAdd){%>${base}/shop/user/save<%}else{%>${base}/shop/user/update<%}%>" class="form-horizontal form-validate">
                        <input type="hidden" name="shopId" value="${shopId!}"/>
                        <input type="hidden" name="memberId" value="${member.id!}"/>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="maroon">*</span>登录名</label>
                            <div class="col-sm-3">
                                <%if (isAdd){%>
                                <input type="text" name="username" value="${member.username!}" class="form-control light-input" required="true">
                                <%}else{%>
                                ${member.username!}
                                <input type="hidden" name="username" class="form-control light-input" value="${member.username!}" />
                                <%}%>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><%if(isAdd){%><span class="maroon">*</span><%}%>密码</label>
                            <div class="col-sm-3">
                                <%if(isAdd){%>
                                <input type="password" name="password" value="" class="form-control light-input" required="true">
                                <%}else{%>
                                <input type="password" name="password" value="" class="form-control light-input">
                                <%}%>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><%if(isAdd){%><span class="maroon">*</span><%}%>重复密码</label>
                            <div class="col-sm-3">
                                <%if(isAdd){%>
                                <input type="password" name="rePassword" value="" class="form-control light-input" required="true">
                                <%}else{%>
                                <input type="password" name="rePassword" value="" class="form-control light-input">
                                <%}%>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">E-mail</label>
                            <div class="col-sm-3">
                                <input type="text" name="email" value="${member.email!}" class="form-control light-input">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="maroon">*</span>头像</label>
                            <div class="col-sm-4">
                                <input type="hidden" name="userimgurl" value="${member.userimgurl!}" class="pull-left form-control light-input"/>
                                <img class="img-rounded" src="${member.userimgurl!}" style="max-height:50px;"/>
                                <input type="button" class="button browserButton " value="选择文件" style="margin-right: 5px"/>建议300*300像素；格式jpg

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">角色</label>
                            <div class="col-sm-3">
                                <select name="roleId" value="${member.roleId!}" class="form-control light-input" style="height: 31px">
                                    <option value="">请选择</option>
                                    <%for(list in roleList){%>
                                    <option value="${list.id}" <%if (list.id == member.roleId!){%> selected<%}%>>
                                    ${list.name}
                                    </option>
                                    <%}%>
                                </select>
                            </div>
                            <span class="color_hint">不选择默认超级管理员角色</span>
                        </div>
                        <%if(isNotEmpty(brandStoreList)){%>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">所属部门</label>
                                <div class="col-sm-3">
                                    <select name="brandStoreId" value="" class="form-control light-input" style="height: 31px">
                                        <option value="">请选择</option>
                                        <%for(list in brandStoreList!){%>
                                        <option value="${list.id}" <%if (list.id == member.brandStoreId!){%> selected<%}%>>
                                        ${list.business_name}
                                        </option>
                                        <%}%>
                                    </select>
                                </div>
                            </div>
                        <%}%>
                        <div class="form-group" style="margin-top: 24px">
                            <label class="col-sm-2 control-label "></label>
                            <div class="col-sm-4 col-sm-offset-0">
                                <button class="hive-btn-cancle" id="btn_cancle" type="button" onclick="history.back()">&nbsp;取消&nbsp;</button>
                                <button class="hive-btn hive-btn-primary margin-left-8" type="submit">&nbsp;提交&nbsp;
                                </button>
                            </div>
                        </div>

                    </form>


                </div>
            </div>
        </div>
    </div>
</div>



<% include("../inc/input_js.html"){}%>
<script type="text/javascript">
    var uploadUrl="/file/uploadfile?shopId=${shopId!}&type=d";
    var browserUrl="/file/browser?shopId=${shopId!}";
</script>
<script src="https://static.9hive.cn/global/vendor/file/file.js"></script>
<script type="text/javascript">
    $(function () {
        $("input.browserButton").browser();
    })
</script>
</body>

</html>